package com.genokon.druid.tool;

import com.alibaba.druid.filter.config.ConfigTools;

import java.util.Date;
import java.util.Random;

/**
 * @author by baichaoda
 * @date 2020/7/29 14:14
 */
public class GenerateKeyPassword {
    public static void main(String[] args) throws Exception {
        Random rand = new Random();
        System.out.println("rand.nextDouble():" + String.format("%06d", (int)(rand.nextDouble()*100000)));
//        Date a = new Date(120, 5, 7);
//        System.out.println(a);
//        String[] arr = ConfigTools.genKeyPair(512);
//        System.out.println("privateKey:" + arr[0]);
//        System.out.println("publicKey:" + arr[1]);
//        System.out.println(ConfigTools.encrypt(arr[0], "genokon!@#$"));
//
//        System.out.println(ConfigTools.decrypt("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKLk8dkLfcCoh0oOAIvFcwzDibkXBpGS5/CRpNkMq4rHatcJITkYLO+xaMVu4Px5zaHeMplz5mreYRAaoLtlTMkCAwEAAQ==","F+PLOparWvAYZYRE9kBvnrJXbtdDEex+LOUHhMRC/T5w5HWHQ2HzuwC/ZxVlB5wenOe4I0wFbou/1ryV03lHeg=="));
    }
}
